#include<iostream>
#include<string>

using namespace std;

int find(string str,string str1)
{
    int count=0;
    if(str.size()<str1.size())
        return count;
    for(int i = 0;i<str.size();i++)
    {
        if(str[i] == str1[0])
        {
            if(str1.size() > (str.size() - i) )
                return count;
            if(str1 == str.substr(i,str1.size()))
            {
                count++;
                i+=str1.size();
            }
        }
    }
    return count;
}

int main()
{
    string str,str1;
    cout<<"请输入一个字符串:";
    cin>>str;
    cout<<"请输入需要查找的字符串:";
    cin>>str1;
    cout<<str1<<"在"<<str<<"中"<<"出现的次数为:"<<find(str,str1)<<endl;
    return 0;
}